package com.itzhoun.controller;

import com.itzhoun.annotation.DataDecryption;
import com.itzhoun.request.WriteJava;
import com.itzhoun.response.ResponseData;
import org.springframework.web.bind.annotation.*;

/**
 * @author 周楠
 * @Date 2022/11/30/下午 8:16
 */
@RestController
@RequestMapping("hello")
public class HelloController {

    @GetMapping("java")
    public ResponseData<String> readJava(  String str){
        return ResponseData.ok(str);
    }

    @PostMapping("java")
    public ResponseData<String> writeJava(@RequestBody WriteJava writeJava){
        System.out.println("解密的数据" + writeJava.getStr());
        return ResponseData.ok(writeJava.getStr());

    }

    @GetMapping("jav")
    public ResponseData<WriteJava> getJava(String java){
        WriteJava writeJava = new WriteJava();
        writeJava.setStr(java);
        return ResponseData.ok(writeJava);
    }
}
